package com.ioftv.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ioftv.entity.LabelerDailyOutput;
import com.ioftv.mapper.LabelerDailyOutputMapper;
import com.ioftv.service.LabelerDailyOutputService;
import com.ioftv.service.base.BaseService;
import org.springframework.stereotype.Service;

/**
 * 标注员每日产值记录Service实现类
 */
@Service
public class LabelerDailyOutputServiceImpl extends BaseService<LabelerDailyOutputMapper, LabelerDailyOutput> implements LabelerDailyOutputService {

    @Override
    protected void addUserCondition(LambdaQueryWrapper<LabelerDailyOutput> queryWrapper) {
        queryWrapper.eq(LabelerDailyOutput::getUserId, getCurrentUserId());
    }

    @Override
    protected void setEntityUserId(LabelerDailyOutput entity) {
        if (entity.getUserId() == null) {
            entity.setUserId(getCurrentUserId());
        }
    }
}